<template>
  <div class="cover" v-show="show">
    <div class="outer" :style="outerStyle">
      <div class="card" :style="cardStyle">
        <slot></slot>
        <svg v-show="closeBtn==undefined?true:closeBtn" class="icon close" aria-hidden="true" @click="$emit('close')">
          <use xlink:href="#icon-close" />
        </svg>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'versionCard',
  props: ['show', 'outerStyle', 'cardStyle', 'closeBtn']
}
</script>
<style lang="scss" scoped>
.cover{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0005;
}
.outer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 80%;
  flex: 1;
  margin: 20px;
  background: white;
  min-height: 200px;
  padding: 20px;
}
.close {
  position: absolute;
  color: gray;
  right: 14px;
  top: 14px;
}
</style>